<ul class="hmenu">
  <%= render 'devise/menu/registration_items' %>
  <%= render 'devise/menu/login_items' %>
</ul>
<h1>Desktop</h1>
<%=link_to "获取通讯录",oauth_consumers_path%>
<% if !@addressbook_info.nil? && @addressbook_info.size > 0%>
	<% @addressbook_info.each do |adi| %>
	<% user_mobile = ""%>
	<% user_name = ""%>
	<% user_id = ""%>
	<% user_avatar = ""%>
	<% user_fn = ""%>
	<% user_fm = ""%>
	<% user_fl = ""%>
	<% user_pop = ""%>
		<% values = adi.split("^")%>
		<% if values[0] == "PersonLastNameProperty"%>
			<% user_fn = values[1].to_s%>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "PersonMiddleNameProperty"%>
			<% user_fm = values[1].to_s%>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "PersonFirstNameProperty"%>
			<% user_fl = values[1].to_s%>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "PersonOrganizationProperty"%>
			<% user_pop = values[1].to_s%>
		<% end %>
		<% if values[0] == "_$!<Mobile>!$_" && user_mobile == ""%>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "_$!<Home>!$_"  && user_mobile == "" %>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "_$!<Work>!$_"  && user_mobile == ""%>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "_$!<Main>!$_"  && user_mobile == ""%>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
		<% if values[0] == "iphone"  && user_mobile == ""%>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
		<%if values[0] == "_$!<Other>!$_" && user_mobile == ""%>
			<% user_mobile = values[1].to_s %>
			<% user_id = values[2].to_s%>
		<% end %>
	<% user_mobile = getPhoneNumber(user_mobile)%>
	<% user_name = user_fn.to_s + user_fm.to_s + user_fl.to_s%>
	<% if user_name == "" %>
		<% user_name = user_pop.to_s %>
	<% end %>
		 <li class="<%= user_mobile %>" id= "<%= user_id %>">
		<% res = "/assets/touxiang.png"%>
		<div style="background: url(<%=res.to_s%>) 0 0 no-repeat;background-size:100% 100%;"></div>
		<div >
		<span > <%= user_name %> </span>
		<span ><%= user_mobile %></span>
	<% end %>
<% end %>